<template>
  <div>
    <div style="margin-bottom: 1rem;"></div>
    <!-- <BreakSpace label="维修项目列表" :containerStyle="{ marginBottom: '10px' }" /> -->
    <FilterTable
      ref="table"
      :columns="columns"
      :params="fetchParams"
      :fetchapi="fetchapi"
      :datakey="'records'"
      :onColumnsChange="columns => (this.columns = columns)"
      :onRowSelectChange="selectChange"
      selectionType="single"
      :is-select-column="false"
      height="auto"
      :isPagination = true
    >
    </FilterTable>
  </div>
</template>
<!--  getSpList  与索赔申请共用一个借口，通过工单号查询出所有的维修记录 -->
<script>
  import {  getListByPage }  from '@/api/claim/dealer/AuthApplication/index';
  export default {
    // mixins: [dictionary],
    props:['vin'],
    data() {
      return {
        dataList: [],
        dataList1: [],
        visible: false,
        visibleDrawer: false,
        collapse: false,
        infoId: null,
        // topFilterInit: this.topFilterInitFun(),
        flterValue: {}, //参数
        columns: this.creatHeader(),
        fetchapi: getListByPage,
        fetchParams: { vin: this.vin,authStatusStrs: '55031002, 55031003, 55031004, 55031005'}, //ipa 接口
        selectedRows: [], //选中经销商
        saveData: null,
        activeName: '',
        menus: [
          {
            title: '审核记录',
            path: 'tabs/user',
            params: {
              type: 1
            }
          },
          {
            title: '维修历史',
            path: 'tabs/setting',
            disabled: true,
            params: {
              type: 2
            }
          }
        ]
      };
    },
    created() {
    },
    methods: {
      formChangeHandle(val) {
        this.saveData = val;
      },
      //搜索获取数据
      changeHandle(val) {
        this.fetchParams = Object.assign({}, this.fetchParams, val);
      },
      //选中
      selectChange(rows) {
        this.selectedRows = rows;
        console.log(this.selectedRows);
      },
      //保存
      saveDialog() {
        this.$refs.formPanel1.SUBMIT_FORM();
        if (this.saveData) {
          this.$emit('save', this.selectedRows);
        }
      },
      //取消操作
      closeDialog() {
        this.$emit('close', { visible: false, data: this.selectedRows, type: 'close' });
      },
      chooseOrderNo() {
        this.visible = true;
      },
      add() {},


      //table表头和数据源
      creatHeader() {
        return [
          {
            title: '序号',
            dataIndex: 'index',
            width: 80,
            sorter: true,
            render: props => {
              return <span>{props.row.index + 1}</span>;
            }
          },
          { title: 'VIN', dataIndex: 'vin', sorter: true },
          { title: '索赔经销商', dataIndex: 'ownerCode', sorter: true },
          { title: '审核状态', dataIndex: 'statusStr', sorter: true },
          { title: '提交人', dataIndex: 'submitBy', sorter: true },
          { title: '提交时间', dataIndex: 'submitAt', sorter: true },
          ];
      },

    }
  };
</script>

<style lang="less" scoped></style>
